home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / bbs_util / bsrc_260.zip / INCLUDE.ZIP / ZMODEM.H < prev   
Text File  |  1996-02-20  |  10KB  |  251 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software, Co.                       */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          Freely Available<tm> Software.                 */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*              (C) Copyright 1987-96, Bit Bucket Software Co.              */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*                                                                          */
  14. /*                   Zmodem definitions for BinkleyTerm                     */
  15. /*                                                                          */
  16. /*                                                                          */
  17. /*    For complete  details  of the licensing restrictions, please refer    */
  18. /*    to the License  agreement,  which  is published in its entirety in    */
  19. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.260.    */
  20. /*                                                                          */
  21. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  22. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  23. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  24. /*    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    */
  25. /*    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    */
  26. /*    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    */
  27. /*    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    */
  28. /*    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      */
  29. /*                                                                          */
  30. /*                                                                          */
  31. /* You can contact Bit Bucket Software Co. at any one of the following      */
  32. /* addresses:                                                               */
  33. /*                                                                          */
  34. /* Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             */
  35. /* P.O. Box 460398                AlterNet 7:42/1491                        */
  36. /* Aurora, CO 80046               BBS-Net  86:2030/1                        */
  37. /*                                Internet f491.n343.z1.fidonet.org         */
  38. /*                                                                          */
  39. /* Please feel free to contact us at any time to share your comments about  */
  40. /* our software and/or licensing policies.                                  */
  41. /*                                                                          */
  42. /*                                                                          */
  43. /*  This module is based largely on a similar module in OPUS-CBCS V1.03b.   */
  44. /*  The original work is (C) Copyright 1986, Wynn Wagner III. The original  */
  45. /*  authors have graciously allowed us to use their code in this work.      */
  46. /*                                                                          */
  47. /*--------------------------------------------------------------------------*/
  48.  
  49. #define flushmo()    wait_for_clear()
  50. #define Z_UpdateCRC(cp,crc)        (crctab[((crc >> 8) & 255) ^ cp] ^ (crc << 8))
  51. #define Z_32UpdateCRC(c,crc)    (cr3tab[((int) crc ^ c) & 0xff] ^ ((crc >> 8) & 0x00FFFFFF))
  52.  
  53. /*--------------------------------------------------------------------------*/
  54. /* Routines from N_Zmodem.H ...                                             */
  55. /*--------------------------------------------------------------------------*/
  56.  
  57. #define ZPAD            '*'
  58. #define ZDLE            030
  59. #define ZDLEE            (ZDLE^0100)
  60. #define ZBIN            'A'
  61. #define ZHEX            'B'
  62. #define ZBIN32            'C'
  63.  
  64. /*--------------------------------------------------------------------------*/
  65. /* Frame types (see array "frametypes" in zm.c)                             */
  66. /*--------------------------------------------------------------------------*/
  67.  
  68. #define ZRQINIT            0
  69. #define ZRINIT            1
  70. #define ZSINIT            2
  71. #define ZACK            3
  72. #define ZFILE            4
  73. #define ZSKIP            5
  74. #define ZNAK            6
  75. #define ZABORT            7
  76. #define ZFIN            8
  77. #define ZRPOS            9
  78. #define ZDATA            10
  79. #define ZEOF            11
  80. #define ZFERR            12
  81. #define ZCRC            13
  82. #define ZCHALLENGE        14
  83. #define ZCOMPL            15
  84. #define ZCAN            16
  85. #define ZFREECNT        17
  86. #define ZCOMMAND        18
  87. #define ZSTDERR            19
  88.  
  89. /*--------------------------------------------------------------------------*/
  90. /* ZDLE sequences                                                           */
  91. /*--------------------------------------------------------------------------*/
  92.  
  93. #define ZCRCE            'h'
  94. #define ZCRCG            'i'
  95. #define ZCRCQ            'j'
  96. #define ZCRCW            'k'
  97. #define ZRUB0            'l'
  98. #define ZRUB1            'm'
  99.  
  100. /*--------------------------------------------------------------------------*/
  101. /* Z_GetZDL return values (internal)                                        */
  102. /* -1 is general error, -2 is timeout                                       */
  103. /*--------------------------------------------------------------------------*/
  104.  
  105. #define GOTOR            0400
  106. #define GOTCRCE            (ZCRCE|GOTOR)
  107. #define GOTCRCG            (ZCRCG|GOTOR)
  108. #define GOTCRCQ            (ZCRCQ|GOTOR)
  109. #define GOTCRCW            (ZCRCW|GOTOR)
  110. #define GOTCAN            (GOTOR|030)
  111.  
  112. /*--------------------------------------------------------------------------*/
  113. /* Byte positions within header array                                       */
  114. /*--------------------------------------------------------------------------*/
  115.  
  116. #define ZF0                3
  117. #define ZF1                2
  118. #define ZF2                1
  119. #define ZF3                0
  120. #define ZP0                0
  121. #define ZP1                1
  122. #define ZP2                2
  123. #define ZP3                3
  124.  
  125. /*--------------------------------------------------------------------------*/
  126. /* Bit Masks for ZRINIT flags byte ZF0                                      */
  127. /*--------------------------------------------------------------------------*/
  128.  
  129. #define CANFDX            01
  130. #define CANOVIO            02
  131. #define CANBRK            04
  132. #define CANCRY            010
  133. #define CANLZW            020
  134. #define CANFC32            040
  135.  
  136. /*--------------------------------------------------------------------------*/
  137. /* PARAMETERS FOR ZFILE FRAME...                                            */
  138. /*--------------------------------------------------------------------------*/
  139.  
  140. /*--------------------------------------------------------------------------*/
  141. /* Conversion options one of these in ZF0                                   */
  142. /*--------------------------------------------------------------------------*/
  143.  
  144. #define ZCBIN            1
  145. #define ZCNL            2
  146. #define ZCRESUM            3
  147.  
  148. /*--------------------------------------------------------------------------*/
  149. /* Management options, one of these in ZF1                                  */
  150. /*--------------------------------------------------------------------------*/
  151.  
  152. #define ZMNEW            1
  153. #define ZMCRC            2
  154. #define ZMAPND            3
  155. #define ZMCLOB            4
  156. #define ZMSPARS            5
  157. #define ZMDIFF            6
  158. #define ZMPROT            7
  159.  
  160. /*--------------------------------------------------------------------------*/
  161. /* Transport options, one of these in ZF2                                   */
  162. /*--------------------------------------------------------------------------*/
  163.  
  164. #define ZTLZW            1
  165. #define ZTCRYPT            2
  166. #define ZTRLE            3
  167.  
  168. /*--------------------------------------------------------------------------*/
  169. /* Parameters for ZCOMMAND frame ZF0 (otherwise 0)                          */
  170. /*--------------------------------------------------------------------------*/
  171.  
  172. #define ZCACK1            1
  173.  
  174. /*--------------------------------------------------------------------------*/
  175. /* Miscellaneous definitions                                                */
  176. /*--------------------------------------------------------------------------*/
  177.  
  178. #define OK                0
  179. #define ERROR            (-1)
  180. #define TIMEOUT            (-2)
  181. #define RCDO            (-3)
  182. #define FUBAR            (-4)
  183.  
  184. #define XON                ('Q'&037)
  185. #define XOFF            ('S'&037)
  186. #define CPMEOF            ('Z'&037)
  187.  
  188. #define RXBINARY        FALSE
  189. #define RXASCII            FALSE
  190. #define LZCONV            0
  191. #define LZMANAG            0
  192. #define LZTRANS            0
  193. #define PATHLEN            128
  194. #define KSIZE            1024
  195. #define WAZOOMAX        8192
  196. #define SECSPERDAY        (24L*60L*60L)
  197.  
  198. /*--------------------------------------------------------------------------*/
  199. /* Parameters for calling ZMODEM routines                                   */
  200. /*--------------------------------------------------------------------------*/
  201.  
  202. #define SPEC_COND        2
  203. #define TRUE            1
  204. #define FALSE            0
  205. #define END_BATCH        (-1)
  206. #define NOTHING_TO_DO    (-2)
  207. #define DELETE_AFTER    '-'
  208. #define TRUNC_AFTER        '#'
  209. #define NOTHING_AFTER    '@'
  210. #define DO_WAZOO        TRUE
  211. #define DONT_WAZOO        FALSE
  212.  
  213. /*--------------------------------------------------------------------------*/
  214. /* ASCII MNEMONICS                                                          */
  215. /*--------------------------------------------------------------------------*/
  216.  
  217. #define NUL    0x00
  218. #define SOH    0x01
  219. #define STX    0x02
  220. #define ETX    0x03
  221. #define EOT    0x04
  222. #define ENQ    0x05
  223. #define ACK    0x06
  224. #define BEL    0x07
  225. #define BS     0x08
  226. #define HT     0x09
  227. #define LF     0x0a
  228. #define VT     0x0b
  229. #define FF     0x0c
  230. #define CR     0x0d
  231. #define SO     0x0e
  232. #define SI     0x0f
  233. #define DLE    0x10
  234. #define DC1    0x11
  235. #define DC2    0x12
  236. #define DC3    0x13
  237. #define DC4    0x14
  238. #define NAK    0x15
  239. #define SYN    0x16
  240. #define ETB    0x17
  241. #define CAN    0x18
  242. #define EM    0x19
  243. #define SUB    0x1a
  244. #define ESC    0x1b
  245. #define FS    0x1c
  246. #define GS    0x1d
  247. #define RS    0x1e
  248. #define US    0x1f
  249.  
  250. /* END OF FILE: zmodem.h */
  251.